<?php

namespace common\models;


class SellGoods extends \common\components\ARModel
{
    const STATE_YES = 1;
    const STATE_NO = -1;

    public $images;

    public function rules()
    {
        return [
            [['goods_name', 'amount', 'score', 'img', 'content', 'state'], 'required'],
            [['score', 'sort', 'state'], 'integer'],
            [['amount'], 'number'],
            [['sort'], 'integer', 'max' => 255],
            [['img'], 'string', 'max' => 128],
            [['goods_name'], 'string', 'max' => 255],
            [['sort'], 'default', 'value' => 50],
        ];
    }

    public function attributeLabels()
    {
        return [
            'goods_id'  => '商品ID',
            'goods_name' => '商品名称',
            'amount' => '商品价格',
            'score' => '所需积分',
            'sort' => '排序',
            'img' => '缩略图',
            'content' => '商品介绍',
            'state' => '状态',
            'created_at' => '添加时间'
        ];
    }

    /****************************** 以下为设置关联模型的方法 ******************************/
}